package app.view.helper
{
	import flash.display.Sprite;
	import flash.text.AntiAliasType;
	import flash.text.TextFormat;
	
	public class BaseView extends Sprite
	{
		public function BaseView()
		{
			
		}
		
		//move to BaseView
		private function radianToDegree( num:Number ) : Number
		{
			return num * 180 / Math.PI;
		}
		//move to BaseView
		public function formatText(field:*, text:String, format:TextFormat, autoSize:String = "left", selectable:Boolean=false, thickness:int = 0, sharpness:int = 0, letterSpacing:Number = 0):void
		{
			var tf:TextFormat = field.getTextFormat();
			tf.font = format.font;
			tf.color = format.color;
			tf.size = format.size;
			tf.bold = format.bold;
			tf.italic = format.italic;
			tf.underline = format.underline;
			tf.letterSpacing = letterSpacing;
			
			field.embedFonts = true;
			field.antiAliasType = AntiAliasType.ADVANCED;
			field.thickness = thickness;
			field.sharpness = sharpness;
			field.autoSize = autoSize;
			field.selectable = selectable;
			field.defaultTextFormat = tf;//<< sets format for any text added after setTextFormat is is applied
			field.htmlText = (text) ? text : '';
			field.setTextFormat(tf); //<< sets format of text currently in field, overwrites any html currently in field, i.e. <br/> tags in xml - (use carraige return in xml for line breaks)
		}
		
	}
}